
list1 = []
list2 = list()
list3 = [1, 2, 3, 4, 5,'aa','bb']
for i in list3:
    print(i, end='')
[1, 2, 3, 4]
[2, 3, 4]
[2, 3, 4, 5,'aa','bb']
print(list3[:4])
print(list3[1:4])
print(list3[1:])
print(list3[-1])
print(list3[::2])

str = "hello world"
for i in str:
    print(i)


list3.append(6)
list3.extend([7,8,9])
list3.insert(0,0)
print()
for i in list3:
    print(i,end='')

list4 = [76,28,13,45,55,13,13]
# list4.sort()
# print(list4)
# list.sort(reverse=True)
# print(list4)

list_new = sorted(list4)
print(list_new)
print(list4)

del list4[0]
print(list4)

list4.remove(13)
print(list4)

list4.pop()
print(list4)

list4.clear()
print(list4)

list5 = [11,8,13,9,5,13,14]
list5_new = sorted(i for i in list5 if i > 10)
# list5_new = sorted(i for i in list5 if i % 2 == 0)
print(list5_new)

list5_new2 = []
for i in list5:
    if i % 2 == 10:
        list5_new2.append(i)

tuple1 = (1,2,3,4,5)
print(tuple1)
tuple2 = (1,)
for i in tuple1:
    print(i)
print(tuple1[0])
print(tuple1[1:4])
print(tuple1[1:])
print(tuple1[:3])
print(tuple1[::2])

set1 = set([1,2,3,4,5,3,4,7,1])
print(set1)
set1.remove(1)
print(set1)
set1.discard(2)
print(set1)
set1.pop()
print(set1)
set1.clear()
print(set1)


dict1 = {'name':'张三','age':18,'sex':'男'}
print(dict1)
print(dict1['name'])
print(dict1.get('gander','没有相关数据'))

print(type(dict1.keys()))
list7 = list(dict1.keys())
print(list7)
for i in dict1.keys():
    print(i,end='')
dict1['id'] = 1001
print(dict1)

dict1['id'] = 1010
print(dict1)
dict1.pop('sex')
print(dict1)

item = dict1.popitem()
print(item)
print(type(item))
print(dict1)


list8 = [1,2,3]
list9 = [4,5,6]
print(list8+list9)

print("*"*10)
print(list8*3)
print(1 in list8)
print(4 in list8)